home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Deutsche Edition 1
/
Deutsche Edition 1.iso
/
amok
/
amok_lha
/
amok18.lha
/
IFFLib
/
Grabber.mod
< prev
next >
Wrap
Text File
|
1993-08-15
|
2KB
|
54 lines
(*---------------------------------------------------------------------------
:Program. Grabber.mod
:Author. Fridtjof Siebert
:Address. Nobileweg 67, D-7-Stgt-40
:Shortcut. [fbs]
:Version. 1.0
:Date. 25-Feb-89
:Copyright. PD
:Language. Modula-II
:Translator. M2Amiga v3.1d
:Imports. IFFLib [fbs]/Christian A. Weber
:Contents. Demonstration for IFFLib. Saves first screen as iff-file.
:Remark. You must have iff.library in your LIBS: directory.
:Remark. Original Assembler-Version by Christian A. Weber
:Usage. Grabber <Where to save Pic>
---------------------------------------------------------------------------*)
MODULE Grabber;
FROM SYSTEM IMPORT ADR, ADDRESS;
FROM Arts IMPORT Terminate;
FROM Arguments IMPORT NumArgs, GetArg;
FROM Exec IMPORT OpenLibrary, CloseLibrary;
FROM Graphics IMPORT ViewModes;
FROM Intuition IMPORT IntuitionBase;
FROM Terminal IMPORT WriteString, WriteLn;
FROM IFFLib IMPORT SaveIFFFlagSet, SaveIFFFlags, SaveBitMap;
VAR
name: ARRAY[0..79] OF CHAR;
intuition: POINTER TO IntuitionBase;
i: INTEGER;
f: SaveIFFFlagSet;
b: BOOLEAN;
colTab: ADDRESS;
BEGIN
IF NumArgs()=0 THEN
WriteString("Usage: Grabber <filename>"); WriteLn;
WriteString(" saves first screen to filename."); WriteLn;
Terminate(0);
END;
GetArg(1,name,i);
intuition := ADDRESS(OpenLibrary(ADR("intuition.library"),NIL));
WITH intuition^.firstScreen^ DO
f := SaveIFFFlagSet{cmpByteRun1};
IF ham IN viewPort.modes THEN INCL(f,saveHAM) END;
colTab := viewPort.colorMap^.colorTable;
b := SaveBitMap(ADR(name),ADR(bitMap),colTab,f);
END;
CloseLibrary(ADDRESS(intuition));
END Grabber.